package com.qf.advice;

import org.springframework.aop.BeforeAdvice;
import org.springframework.aop.MethodBeforeAdvice;

import java.lang.reflect.Method;

/**
 * @author 汤奇
 * @version V1.0
 * @Project BookPro
 * @Package com.qf.advice
 * @Description:    前置通知:
 *                      先执行前置通知功能, 例如: 开启事务, 打印日志等
*                       再执行核心业务方法, 也就是service中的增删改
 * @Date 2022/6/6 11:30
 */
public class MyBeforeAdvice implements MethodBeforeAdvice {
    @Override
    public void before(Method method, Object[] objects, Object o) throws Throwable {
        System.out.println("=====开启事务MethodBeforeAdvice前置通知====");
        System.out.println("=====打印日志MethodBeforeAdvice前置通知====");
    }
}
